package com.caiyouxi.finance.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.control.BaseController;
import com.caiyouxi.finance.model.FinanceAccount;
import com.caiyouxi.finance.service.FinanceAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by Administrator on 2017/11/09.
 */
@RestController
@RequestMapping("/finance_account")
public class FinanceAccountController extends BaseController {

    @Autowired
    private FinanceAccountService financeAccountService;
    
    /**
     * 查询账户信息
     */
    @RequestMapping("/get_balance")
    public ResData add_order(HttpServletRequest request, HttpServletResponse response, @RequestBody FinanceAccount bean) {
        FinanceAccount fa = financeAccountService.select_finance_account_by_uiaccaac(bean.getCurrency_code(),bean.getAccount_code(),bean.getUser_id());
        return success(fa);
    }

    /**
     * 分页查询
     * wushihao
     * */
    @RequestMapping("/finance_account_list")
    public ResData finance_account_list(@RequestBody FinanceAccount bean){
        return financeAccountService.finance_account_list(bean);
    }

}
